package algo_annotations.ihm.couche;

import algo_annotations.data.Data_a;
import algo_annotations.data.annotations.Anno;
import algo_annotations.data.sites.Site;
import commons.data.I_Data.DataType;
import commons.drawing.I_Drawable;
import commons.drawing.RectDrawable;
import commons.drawing.couche.CoucheBasic;
import commons.utils.primitive_geom.Rect_d;
import java.awt.Color;
import java.util.ArrayList;


public class CoucheSite_rectMax extends CoucheBasic {

	public CoucheSite_rectMax(Data_a data) {
		super("Site rectmax", null, data);
	}

	@Override
	public ArrayList<I_Drawable> getDrawables(Rect_d rectVisu) {
		ArrayList<Anno> vAnno = data.getData(DataType.ANNO_A, rectVisu);

		if (vAnno ==null)
			return null;

		ArrayList<I_Drawable> vSiteRectMax = new ArrayList<I_Drawable>(vAnno.size());
		for (Anno anno : vAnno) {
			if (!anno.site.hasAnno()) continue; // site sans anno
			if(anno.site.bIsPreplace()) continue;
			vSiteRectMax.add(new RectDrawable(anno.site.rectMax_reel_m, Color.BLACK, Color.LIGHT_GRAY));
		}

		return vSiteRectMax;
	}
}
